package com.sq.partner.manager.dao.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.sq.partner.manager.dao.CommamtFeeDao;
import com.sq.partner.manager.mybatis.model.CommamtFee;
import com.sq.partner.manager.util.Page;
@Repository
public class CommamtFeeDaoImpl extends BaseDaoImpl implements CommamtFeeDao {

	@Override
	public boolean insertCommamtInfo(CommamtFee commamtFee) throws Exception {
		return this.add("insertCommamtFee", commamtFee);
	}
	
	/**
	 * 根据条件分页查询多条申请信息
	 * @param applyinfo
	 * @return
	 * @throws Exception
	 */
	@SuppressWarnings("unchecked")
	@Override
	public Page<CommamtFee> queryCommamtFeeList(Page<CommamtFee> page) throws Exception{
		Map<String,Object> paramMap = page.getMap();
		page.setTotal((Integer)this.query("queryCommamtFeeCount", paramMap));
		page.setData((List<CommamtFee>)this.queryList("queryCommamtFeeList",paramMap));
		return page;
	}

	/**
	 * 更新出库费用表
	 */
	@Override
	public boolean updatCommamtInfo(HashMap<String, Object> param) throws Exception{
		return this.update("updateCommamtInfo", param);
	}

	@Override
	public CommamtFee getCommamtInfoByCommamtId(String commamtId) throws Exception{
		return (CommamtFee)this.query("getCommamtInfoByCommamtId", commamtId);
	}

	@Override
	public CommamtFee queryForPay(String commamtId) throws Exception {
		
		return (CommamtFee) this.query("queryForPay", commamtId);
	}
	
	/**
	 * 更新会传收付状态
	 */
	@Override
	public void updateBackPayFlagByCommamtId(HashMap<String, Object> param)
	        throws Exception {
	    this.update("updateBackPayFlagByCommamtId", param);
	}
}

